package com.dayuan.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dayuan.bean.Stock;
import com.dayuan.dao.StockMapper;

@Service
public class StockService {

	@Resource
	private StockMapper stockMapper;

	/* 查询库存量（悲观锁） */
	public Stock selectStock(Integer goodsId) {

		return stockMapper.selectStock(goodsId);
	}

	/* 减库存 */
	public void updateStock(Stock stock) {

		 stockMapper.updateStock(stock);
	}

}
